package Homework.Top9;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Market m= new Market();
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请选择:1.显示信息  2.查询商品信息    3.修改商品信息    4.购买商品  5.添加商品  6.退出");
            int choice = sc.nextInt();
            if (choice == 1) {
                m.show();
            } else if (choice == 2) {
                System.out.println("请输入查询的商品号：");
                String itemno=sc.next();
                m.showProduct(itemno);
            } else if (choice == 3) {
                System.out.println("请输入商品号：");
                String it=sc.next();
                System.out.println("请输入修改数量：");
                int st=sc.nextInt();
                m.amendCommodity(it,st);
            } else if (choice == 4) {
                break;
            } else if (choice == 5) {
                break;
            } else {
                break;
            }
        }


    }
}
